var ucenter = {
	/*
	 * 修改密码
	 */
	editPassword: function(postInfo, callback) {
		var ajax = new ajaxRequest();
		ajax.addData('mobile', postInfo.mobile);
		ajax.addData('code', postInfo.code);
		ajax.addData('password', postInfo.password);
		ajax.request('person/edit_password', function(res) {
			callback(res);
		})
	},
	/*
	 * 注册
	 */
	regUser: function(postInfo, callback) {
		var ajax = new ajaxRequest();
		ajax.addData('mobile', postInfo.mobile);
		ajax.addData('code',parseInt(postInfo.code));
		ajax.addData('password', postInfo.password);
		ajax.request('Login/register', function(res) {
			callback(res);
		})
	},
	
	/*
	 * 获取验证码
	 */
	getLoginVerify: function(postInfo, callback) {
		var mobile = postInfo.mobile;
		var ajax = new ajaxRequest();
		ajax.addData('mobile', mobile);
		ajax.request('Login/mobileCode', function(res) {
			callback(res);
		})
	},
	/*
	 * 验证码登陆
	 */
	fastLogin: function(postInfo, callback) {
		var mobile = postInfo.mobile;
		var code = postInfo.code;
		var ajax = new ajaxRequest();
		ajax.addData('mobile', mobile);
		ajax.addData('code', code);
		ajax.addData('clientid', postInfo.clientid);
		ajax.addData('app_type', postInfo.app_type);
		ajax.request('person/one_login', function(res) {
			callback(res);
		})
	},
	/*
	 * 账号密码登陆
	 */
	accountLogin: function(postInfo, callback) {
		var ajax = new ajaxRequest();
		ajax.addData('mobile', postInfo.mobile);
		ajax.addData('password', postInfo.password);
		ajax.request('Login/login ', function(res) {
			callback(res);
		})
	},
	

	/*
	 * 获取用户信息
	 */
	getUserInfo: function(postInfo, callback) {
		var ajax = new ajaxRequest();
		ajax.addData('pid', postInfo.pid);
		ajax.addData('token', postInfo.token);
		ajax.request('user/get_user_info', function(res) {
			callback(res);
		})
	},

	/*
	 * 修改用户手机号码
	 */
	editMobileInfo: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('mobile', postInfo.mobile);
		ajax.addData('code', postInfo.code);
		ajax.addData('ocode', postInfo.ocode);
		ajax.request('person/edit_mobile', function(res) {
			callback(res);
		})
	},
	/*
	 * 获取用户信息完善情况
	 */
	getUserIsAuth: function(callback) {
		var ajax = new ajaxRequest();
		var userInfo = JSON.parse(apptools.getUserInfo());
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.request('user/data_integrity', function(res) {
			callback(res);
		})
	},
	/*
	 * 添加意见反馈
	 */
	adviceFeedback: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('feedback', postInfo.feedback);
		ajax.request('faqp/add_feedback', function(res) {
			callback(res);
		})
	},
	/*
	 * 获取常见问题
	 */
	getCommQuestion: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('type', postInfo.type);
		ajax.request('faqp/get_faq', function(res) {
			callback(res);
		})
	},
	/*
	 * 获取消息列表
	 */
	getPushMessage: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('type', postInfo.type);
		ajax.addData('page', postInfo.page);
		ajax.addData('pagesize', 10);
		ajax.request('msgp/get_msg', function(res) {
			callback(res);
		})
	},
	/*
	 * 删除消息
	 */
	delPushMessage: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('msg_id', postInfo.msg_id);
		console.log(postInfo.msg_id);
		ajax.request('msgp/del_msg', function(res) {
			callback(res);
		})
	},
	/*
	 * 获取信息详情
	 */
	getPushMessageInfo: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('msg_id', postInfo.msg_id);
		ajax.request('msgp/get_msg_info', function(res) {
			callback(res);
		})
	},

	/*
	 * 更改消息已读
	 */
	editMessageRead: function(postInfo, callback) {
		var userInfo = JSON.parse(apptools.getUserInfo());
		var ajax = new ajaxRequest();
		ajax.addData('pid', userInfo.id);
		ajax.addData('token', userInfo.token);
		ajax.addData('msg_id', postInfo.msg_id);
		ajax.request('msgp/edit_read', function(res) {
			callback(res);
		});
	},
	
}